package pageObject;

import java.net.URL;

import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class TC02 {
	
	WebDriver driver;
	String baseURL, nodeURL;
	
	@BeforeTest
	public void atBeforeTest() throws Exception{
		
		baseURL = "http://www.google.com";
		nodeURL = "http://localhost:8889/wd/hub";
		
		//File file = new File("E:\\Selenium_Projects\\Selenium Files\\IE_Driver_32_bit\\IEDriverServer.exe");
		//System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
		
		//DesiredCapabilities capability = DesiredCapabilities.chrome();
		//DesiredCapabilities capability = new DesiredCapabilities();
		DesiredCapabilities capability = DesiredCapabilities.internetExplorer();
		//capability.setBrowserName("iexplore");
		capability.setBrowserName("firefox");
		//capability.setBrowserName("chrome");
		capability.setPlatform(Platform.XP);
		
		driver = new RemoteWebDriver(new URL(nodeURL),capability);
		
	}
	
	@Test
	public void atTest() throws Exception{
		
		driver.get(baseURL);
		System.out.println(driver.getTitle());
		
	}
}
